import 'package:flutter/material.dart';
import 'package:my_app/route/route_path.dart';
import 'package:my_app/pages/index/index_page.dart';
// 导入 TabPage 组件
import 'package:my_app/pages/tab/tab_page.dart'; 
import 'package:my_app/pages/home/home_page.dart';
class Routes {
  static Route<dynamic> generateRoute(RouteSettings settings) {
    switch (settings.name) {
      case RoutePath.index:
        return MaterialPageRoute(builder: (_) => const IndexPage());
      case RoutePath.tab:
        // 为 /tab 路由添加对应的页面构建逻辑
        return MaterialPageRoute(builder: (_) => const TabPage()); 
      case RoutePath.home:
        // 为 /home 路由添加对应的页面构建逻辑
        return MaterialPageRoute(builder: (_) => const HomePage());
      default:
        return MaterialPageRoute(
          builder: (_) => Scaffold(
            body: Center(
              child: Text('未找到对应的路由: ${settings.name}'),
            ),
          ),
        );
    }
  }
}